import urllib2,urllib,re

def regbla():
	res=[]
	req = urllib2.Request('http://www.dumpert.nl/toppers/')
	req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14')
	response = urllib2.urlopen(req)
	link=response.read()
	for page in range(1,19):
		req = urllib2.Request('http://www.dumpert.nl/toppers/'+str(page) + '/')
    	req.add_header('User-Agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14')
    	response = urllib2.urlopen(req)
    	link=response.read()
    	
    	match=re.compile('<a class="item" href="(.+?)">..<img src="(.+?)" alt="(.+?)"',re.DOTALL).findall(link)
	print match
	
   # for url,name in match:
    #	res.append((url,name))
    #for url,name in res:
	#	f = open('%s/Content.seed'%os.getcwd().replace(";",""), 'a');f.write('<URL>'+url+'</URL><NAME>'+name+'</NAME>');f.close()
     #   addDir(name,url,1,"")
      
regbla()